package com.leyou.trade.config;

import com.leyou.trade.utils.TokenContext;
import feign.Request;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

@Component
public class FeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        Request request = requestTemplate.request();
        requestTemplate.header("Cookie","LY_TOKEN="+ TokenContext.getToken());
    }
}
